package com.example.demo.controller;

import com.example.demo.pojo.PublicFields;
import com.example.demo.pojo.Result;
import com.example.demo.pojo.dto.ComponentDTO;
import com.example.demo.pojo.vo.DataVO;
import com.example.demo.service.IDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping("/data")
@Api(tags = "数据查询接口")
@RequiredArgsConstructor
@CrossOrigin(origins = {"http://localhost:8080"}, allowCredentials = "true")
public class DataController {
    private final IDataService iDataService;
    @ApiOperation("初始化仪表盘")
    @PostMapping("/init")
    public Result deleteDevice(){
        DataVO dataVo=iDataService.init();

        return Result.success(dataVo);
    }
}
